<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSystemConfigsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_configs', function (Blueprint $table) {
            $table->id()->comment('配置表');
            $table->string('menu_name')->comment('配置英文名称');
            $table->string('info')->comment('配置中文名称');
            $table->integer('category_id')->index()->comment('配置分类id');
            $table->string('category_name')->index()->comment('配置分类昵称');
            $table->string('type')->comment('类型 (text,Uploads,radio,textarea...)');
            $table->string('input_type',20)->nullable()->comment('表单类型 (input,number...)');
            $table->string('parameter')->nullable()->comment('参数 单选框和多选框');
            $table->string('upload_type',20)->nullable()->comment('上传文件格式 image images file');
            $table->string('required')->nullable()->comment('规则');
            $table->string('width',100)->nullable()->comment('多文本框的宽度');
            $table->string('height',100)->nullable()->comment('多文本框的高度');
            $table->json('value')->nullable()->comment('默认值');
            $table->string('desc')->nullable()->comment('配置简介');
            $table->integer('sort')->default(0)->comment('排序');
            $table->tinyInteger('status')->default(1)->comment('是否隐藏 0=隐藏 1=显示');
            $table->timestamps();
            $table->softDeletes();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_configs');
    }
}
